package com.baiintent;

import android.os.Bundle;
import android.app.Activity;
import android.content.Intent;
import android.view.Menu;
import android.view.View;
import android.widget.EditText;
import android.widget.TextView;

public class MainActivity2 extends Activity {

	@Override
	protected void onCreate(Bundle savedInstanceState) {
		super.onCreate(savedInstanceState);
		setContentView(R.layout.activity_main2);
		TextView t1=(TextView) findViewById(R.id.t2);
		Intent chagui=getIntent();
		int sonhan=chagui.getIntExtra("jay", -1) + chagui.getIntExtra("jay2", -1);
		t1.setText("" + sonhan);
	}
	public void Guicha(View v){
		EditText e3=(EditText) findViewById(R.id.ed3);
		EditText e4=(EditText) findViewById(R.id.ed4);
		Intent i = getIntent();
		int sogui=Integer.parseInt(e3.getText().toString());
		String Lydo=e4.getText().toString();
		i.putExtra("jay3", sogui);
		i.putExtra("jay4", Lydo);
		this.setResult(this.RESULT_OK,i);
		this.finish();
	}
	


}
